<!--
 * @Author: 丁建行 jianxing.ding@leadchina.cn
 * @Date: 2023-04-24 20:58:35
 * @LastEditors: 丁建行 jianxing.ding@leadchina.cn
 * @LastEditTime: 2023-04-25 18:55:02
 * @FilePath: \eap-web\src\views\login\ssocallback.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    <h1>CallBack</h1>
    <!-- <h1>{{ $route.query.id_token }}</h1> -->
    <!-- <h1>{{ $route.query.token_type }}</h1>
    <h1>{{ $route.query.session_state }}</h1> -->
    <!-- <h1>{{ $route.hash }}</h1> -->
    <el-skeleton :rows="12" animated />
  </div>
    
</template>
  
<script>
  import Oidc from 'oidc-client';
  import router from '@/router';
  import { Loading } from 'element-ui';
  export default {
    name: 'ssocallbackView',
    data() {
      return {
        tableData: [],
        loading: true
      };
    },
    methods: {
      
    },
    mounted () {
      let loadingInstance = Loading.service({ fullscreen: true });
        console.log('App.vue finish re-render')
        console.log(this.$route.fullPath);

        console.log("@@@callback route hash",this.$route.hash)
        let cache_router=this.$router;
        //  new Oidc.UserManager().signinRedirectCallback().then(function () {
        //      this.$router.push({ path: '/login' });
        //  }).catch(function (e) {
        //      console.error(e);
        //  });
        this.$store.state.systemconfig.userManager.signinRedirectCallback(this.$route.fullPath).then(user => {
          console.log('signinRedirectCallback success', user)
          cache_router.push({ path: '/login' });
        }).catch(err => {
          console.error('signinRedirectCallback error', err)
        })
    }
  };
</script>
  